﻿namespace DNBProject.Model.ReportPartial
{
    /// <summary>
    /// The Info Layer Model which is got from web config
    /// </summary>
    public class StaticMaterialModel
    {
        /// <summary>
        /// Gets or Sets Key Layer
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Gets or Sets Name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or Sets Begin Time
        /// </summary>
        public string Formula { get; set; }

        /// <summary>
        /// Gets or Sets Finish Time
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// Gets or Sets Status
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// Gets or Sets Area Id
        /// </summary>
        public string AreaId { get; set; }

        /// <summary>
        /// Override the ToString method
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            var name = (string.IsNullOrEmpty(Name) ? Formula : Name) + " ";
            var formula = (string.IsNullOrEmpty(Formula) ? "" : "(" + Formula + ") ");
            var unit = (string.IsNullOrEmpty(Unit) ? "" : "(" + Unit + ") ");
            return name + formula + unit;
        }
    }
}